You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
558 B
12 lines
558 B
import { softDeleteComment } from "#server/service/post-comments";
|
|
|
|
export default defineWrappedResponseHandler(async (event) => {
|
|
const user = await event.context.auth.requireUser();
|
|
const postId = Number(event.context.params?.postId);
|
|
const commentId = Number(event.context.params?.commentId);
|
|
if (!Number.isInteger(postId) || !Number.isInteger(commentId)) {
|
|
throw createError({ statusCode: 400, statusMessage: "无效请求" });
|
|
}
|
|
await softDeleteComment({ postId, commentId, actorUserId: user.id });
|
|
return R.success({ ok: true });
|
|
});
|
|
|